package intgrafica.principal;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class AlarmeTreinoReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		String nomeTreino = intent.getStringExtra("nomeTreino");

		Toast.makeText(context, "Esta na hora do treino " + nomeTreino + "!!",
				Toast.LENGTH_LONG).show();

		Intent scheduledIntent = new Intent(context, AlarmeTreino.class);

		scheduledIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

		scheduledIntent.putExtra("nomeTreino", nomeTreino);

		context.startActivity(scheduledIntent);

	}
}
